package binaryOctopus;

import javax.swing.*;
import java.awt.*;

/**
 * A clickable image is an image that has a location on the
 * board and has the ability to be clicked.
 */
public class ClickableImage extends JButton {

		//I think we should move the pieces location into a coordinates
		//array instead of two ints
		//private Coordinates[][] coords;
        private int row, column;
        private boolean clicked;
        public boolean isKing;
        
        //probably going to put the predicate function to check if
        //it can move in this class
        public boolean canMove;
        
        //to see if it can jump anything
        public boolean hasJumps = false;

        /**
         * Constructor that creates a button using the icon and
         * sets to be not clicked by default.
         * @param icon an image
         */
        public ClickableImage( ImageIcon icon )
        {
        	super( icon );
            //setClicked( false );
                
        }
       
        /**
         * Sets the row value of the image
         * @param row
         */
        public void setRow (int row)
                { this.row = row; }
        /**
         * Sets the column value of the image
         * @param column
         */
        public void setColumn( int column )
                { this.column = column; }
        /**
         * @return Returns row where image is located
         */
        public int getRow( )
                { return row; }
        /**
         * @return Returns column where image is located
         */
        public int getColumn( )
                { return column; }
        /**
         * Sets the button to be either clicked or not clicked
         * @param b boolean value
         */
        public void setClicked( boolean b)
                { clicked = b; }
        /**
         * @return Returns if the button is clicked or not
         */
        public boolean getClicked( )
                { return clicked; }
        /**
         * Checks if there are any valid jumps for any of the pieces
         * if there is, do it and switch turn.
         */
     	private boolean Check(){
     		if(isKing){
     			//check forwards and back
     			//jump piece if can
     		}else{
     			//check forwards
     			//jump piece if can
     		}
     		return (Boolean) null;
     	}
}

